package com.company.cloud.oss.modules.api.fallback;

import com.company.cloud.common.bean.BaseClientResult;
import com.company.cloud.oss.modules.api.req.*;
import com.company.cloud.oss.modules.api.service.OssRemoteService;
import feign.hystrix.FallbackFactory;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Component;


@Log4j2
@Component
public class OssClientServiceFallbackFactory implements FallbackFactory<OssRemoteService>{

	@Override
	public OssRemoteService create(Throwable cause) {
		return new OssRemoteService() {

			@Override
			public BaseClientResult<String> uploadInputStream(UploadInputStreamParam param) {
				return BaseClientResult.callbackError();
			}

			@Override
			public BaseClientResult<String> uploadByte(UploadByteParam param) {
				return BaseClientResult.callbackError();
			}

			@Override
			public BaseClientResult<String> uploadBase64(UploadBase64Param param) {
				return BaseClientResult.callbackError();
			}

			@Override
			public BaseClientResult<String> uploadSuffix(UploadSuffixParam param) {
				return BaseClientResult.callbackError();
			}
		};
	}

}
